import configparser
import os

from conf.pathConfig import config_path


class readIni:
    filename = config_path


    def __init__(self):
        self.config = configparser.ConfigParser()
        self.config.read(readIni.filename)

    def get_testInfo(self):
        return dict(self.config.items("test"))

    def get_mysqlInfo(self):
        return dict(self.config.items("mysql"))

    def get_ip_port(self):
        return self.get_testInfo().get("ip") + ":" + self.get_testInfo().get("port")


if __name__ == '__main__':
    r = readIni()
    print(r.get_testInfo())
    print(r.get_mysqlInfo())
    print(r.get_ip_port())
